<?php

class template
{
	// load custom js from array
	private $custom_js 				= array();

	// load custom css from array
	private $custom_css 			= array();

	// default html title
	private $default_title 			= "Seo Engine";


	/*
		Input (@array): Load custom js into $custom_js
		Output: null
	*/

	public function load_js( $arr )
	{
		$this->custom_js = $arr;
	}

	public function load_css( $arr )
	{
		$this->custom_css = $arr;
	}

	/*
		Template header
	*/
	public function header( $title = null )
	{
		$temp = "<html><head>";

		// load custom js
		if( count($this->custom_js) > 0 )
		{
			foreach($this->custom_js as $temp_js)
				$temp .= "<script src='".$temp_js."'></script>";
			
		}

		// load custom css
		if( count($this->custom_css) > 0 )
		{
			foreach($this->custom_css as $temp_css)
				$temp .= "<link href='".$temp_css."' rel='stylesheet' />";
		}


		if( !empty($title) )
			$temp .= "<title>".$title."</title>";
		
		else
			$temp .= "<title>".$this->default_title."</title>";

		$temp.="</head><body>";

		return $temp;
	}


	/*
		Template footer
	*/
	public function footer()
	{
		$temp = "</body></html>";

	}
}

?>